//package com.bocsoft.dbsp.base.entity.message;

//import com.bocsoft.dbsp.base.entity.message.RespErrorBody;


public class MyJavaRules34 {

    public M54075Resp m54075Resp;

    /************************测试RespErrorBody类****************************/

    public void exampleWithNullCheck(RespErrorBody response) {
        m54075Resp.setBookNo("1"); // Noncompliant {{接口返回值使用前应做非空检查。}}
        if (response != null) {
            response.doSomething();  // Compliant
        }
    }

    public void exampleWithNullCheck1(RespErrorBody response) {
        if (response == null) {
            return;
        } else {
            response.doSomething();  // Compliant
        }
    }

    public void anotherValidExample() {
        RespErrorBody response = getRespErrorBody();
        if (response != null) {
            response.doSomething();  // Compliant
        }
    }

    public void exampleWithoutNullCheck(RespErrorBody response) {
        response.doSomething();// Noncompliant {{接口返回值使用前应做非空检查。}}
    }

    public void anotherInvalidExample1() {
        RespErrorBody response = getRespErrorBody();
        response.doSomething();// Noncompliant {{接口返回值使用前应做非空检查。}}
    }

    public RespErrorBody getRespErrorBody() {
        return new RespErrorBody();
    }

    /************************测试RespErrorBody类结束****************************/

    /************************测试RespErrorBody子类****************************/
    public void exampleWithNullCheck(MyResponse response) {
        if (response != null) {
            response.doSomething();  // Compliant
        }
    }

    public void exampleWithNullCheck1(MyResponse response) {
        if (response == null) {
            return;
        } else {
            response.doSomething();  // Compliant
        }
    }

    public void anotherValidExample() {
        MyResponse response = getMyResponse();
        if (response != null) {
            response.doSomething();  // Compliant
        }
    }

    public void exampleWithoutNullCheck(MyResponse response) {
        response.doSomething();// Noncompliant {{接口返回值使用前应做非空检查。}}
    }

    public void anotherInvalidExample1() {
        MyResponse response = getMyResponse();
        response.doSomething();// Noncompliant {{接口返回值使用前应做非空检查。}}
    }

    public MyResponse getMyResponse() {
        return new MyResponse();
    }
    /************************测试RespErrorBody子类结束****************************/



}

class RespErrorBody {}

class MyResponse extends RespErrorBody{}

class BaseRespBody extends RespErrorBody{}

class M54075Resp extends BaseRespBody{}

class Response {}